//这是关于员工信息的api接口


//获取员工的简单信息
import request from "@/utils/request.js";
export function getSimpleEmp() {
    return request({
        url: '/sys/user/simple'
    })
}

//获取员工列表
export function getEmployeesList(params) {
    return request({
        url: '/sys/user',
        params
    })
}

//删除员工
export function delEmp(id) {
    return request({
        url: `sys/user/${id}`,
        method: 'delete'

    })
}

//新增员工接口
export function addEmp(data) {
    return request({
        url: '/sys/user',
        method: 'post',
        data
    })
}
//批量新增员工的接口
export function addEmpBatch(data) {
    return request({
        url: '/sys/user/batch',
        method: 'post',
        data
    })
}


//获取员工基本信息
export function getUserBaseInfo(id) {
    return request({
        url: `sys/user/${id}`,
        method: 'get'
    })
}

//修改员工基本信息
export function updateBaseInfo(data) {
    return request({
        url: `/sys/user/${data.id}`,
        method: 'put',
        data
    })
}

//保存员工基本信息
export function savePerInfo(data) {
    return request({
        url: `/sys/user/${data.id}`,
        method: 'put',
        data
    })
}

//获取员工个人信息
export function getPersonInfo(id) {
    return request({
        url: `/employees/${id}/personalInfo`,
    })
}
//保存员工个人信息
export function savePersonInfo(data) {
    return request({
        url: `/employees/${data.userId}/personalInfo`,
        method: 'put',
        data
    })
}

//获取员工岗位信息
export function getEmployeeJobInfo(id) {
    return request({
        url: `/employees/${id}/jobs`,

    })
}
//保存员工岗位信息
export function saveEmployeeJobInfo(data) {
    return request({
        url: `/employees/${data.userId}/jobs`,
        method: 'put',
        data
    })
}


//给角色分配权限
export function setAssignRoles(data) {
    return request({
        url: '/sys/user/assignRoles',
        method: 'put',
        data
    })
}